﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using EuroManager.Domain.Simulator.AI;
using EuroManager.Domain.Simulator.Engine;
using EuroManager.Domain.Simulator.Tactics;

namespace EuroManager.Domain.Simulator.World
{
    public class Team : ITeam
    {
        public const int PlayerCount = 11;

        private IBall ball;
        private PitchSide side;
        private List<IPlayer> players = new List<IPlayer>();

        public Team(PitchSide side, IBall ball)
        {
            Contract.Requires(ball != null);

            this.side = side;
            this.ball = ball;
        }

        public ITeam Opponent { get; set; }

        public PitchSide Side
        {
            get { return side; }
        }

        public IEnumerable<IPlayer> Players
        {
            get { return players; }
        }

        public bool HasBall
        {
            get { return ball.OwningTeam == this; }
        }

        public void Update(float elapsedTime)
        {
        }

        public void AddPlayer(IPlayer player)
        {
            players.Add(player);
        }
    }
}
